package generics;

import java.util.ArrayList;
import java.util.List;

public class GenericInheritance {

    class A {}  
    class B extends A {}  
    class C extends A {}  
    class D extends B {}
    
    @SuppressWarnings({ "rawtypes", "unused" })
	public static void main(String[] args) {
		List list = new ArrayList();
    	List<?> unknown = null;
    	List<? extends B> uB = null;   
    	List<? extends A> uA = null;
    	List<Object> o = null; 
    	List<B> b = null;
    	List<A> a = null;
//    	List<C> c = null;
    	List<D> d = null;
    	
    	list = a;
//    	a = b;
    	unknown = o;
    	uB = d;
//    	a = uA;
    	list = o;
    	uA = uB;
    	
    }
//    Which three statements are true? (Choose three.)  
//    A. The type List<A> is assignable to List. +   
//    B. The type List<B> is assignable to List<A>. -   
//    C. The type List<Object> is assignable to List<?>. +   
//    D. The type List<D> is assignable to List<? extends B>.  
//    E. The type List<? extends A> is assignable to List<A>.  
//    F. The type List<Object> is assignable to any List reference.  
//    G. The type List<? extends B> is assignable to List<? extends A>.  
//    Answer: CDG  
	
}
